package com.dmall.sort.algorithm;

import java.util.Arrays;

/**
 * @author xiao1.wang
 * @date 2021/10/11 22:29
 */
@SuppressWarnings("all")
public class Application2 {
    public static void main(String[] args) {
        Sort sort1 = new InsertionSort();
        Sort sort2 = new BinaryInsertionSort();
        Sort sort3 = new PairInsertionSort();
        Sort sort4 = new MergeSort();

        // int[] arr0 = SortHelper.generateRandomArray(400000, 0, 1000000);
        // int[] arr0 = SortHelper.generateNearlyOrderedArray(1000000, 10);
        int[] arr0 = SortHelper.generateNearlyReverseOrderedArray(400000, 0);
        int[] arr1 = Arrays.copyOf(arr0, arr0.length);
        int[] arr2 = Arrays.copyOf(arr0, arr0.length);
        int[] arr3 = Arrays.copyOf(arr0, arr0.length);
        int[] arr4 = Arrays.copyOf(arr0, arr0.length);

        // SortHelper.testSort(sort1, arr1);
        SortHelper.testSort(sort2, arr2);
        SortHelper.testSort(sort3, arr3);
        SortHelper.testSort(sort4, arr4);
    }
}
